package be.tihh.mgmt.tasks;

import be.tihh.mgmt.gui.xml.computers.Computer;

public abstract class ComputerTask implements Task {

    protected Computer computer;
    protected TaskStatus taskStatus;
    protected boolean isInitialized = false;

    public void execute() {
        if(!isInitialized){
            System.out.println("task is not initialized - you should call initialize(Computer) method of ComputerTask first");
            System.exit(1);
        }
    }

    public void initialize(Computer computer) {
        this.computer = computer;
        taskStatus = new TaskStatus();
        isInitialized = true;
    }

    public TaskStatus getTaskStatus() {
        return taskStatus;
    }

    public Computer getComputer() {
        return computer;
    }
}
